﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using AttributeRouting;
using AttributeRouting.Web.Mvc;

namespace Invoicing.Web.Management.Controllers
{
    public class GlobalController : Controller
    {
        [Route("")]
        [Route("Login")]
        [HttpGet]
        public ActionResult Login()
        {
            return View();
        }

        [Route("Logout")]
        [HttpGet]
        public ActionResult Logout()
        {
            Invoicing.Web.Global.WebContext.LogOut();
            System.Web.Security.FormsAuthentication.SignOut();
            return View("Login");
        }

        [Route("Success")]
        [Route("Success/{cat}/{orderNo}")]
        [Authorize]
        public ActionResult Success(string cat = null, string orderNo = null)
        {
            ViewBag.Cat = cat;
            ViewBag.OrderNo = orderNo;
            return View();
        }

        [Route("Home")]
        [Authorize]
        public ActionResult Home()
        {
            return View();
        }
    }
}
